﻿' ----------------------------------------------------------------------------------
' Microsoft Developer & Platform Evangelism
' 
' Copyright (c) Microsoft Corporation. All rights reserved.
' 
' THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 
' OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ----------------------------------------------------------------------------------
' The example companies, organizations, products, domain names,
' e-mail addresses, logos, people, places, and events depicted
' herein are fictitious.  No association with any real company,
' organization, product, domain name, email address, logo, person,
' places, or events is intended or should be inferred.
' ----------------------------------------------------------------------------------

Imports Microsoft.Samples.WindowsPhoneCloud.Web.Infrastructure
Imports System.ComponentModel.DataAnnotations
Imports System.ComponentModel

Namespace Models
    Public Class RegisterModel
        Private userNameValue As String
        Private passwordValue As String
        Private confirmPasswordValue As String
        Private emailValue As String

        <Required()> _
        <Display(Name:="User name")> _
        Public Property UserName() As String
            Get
                Return userNameValue
            End Get
            Set(ByVal value As String)
                userNameValue = value
            End Set
        End Property

        <Required()> _
        <DataType(DataType.EmailAddress)> _
        <Display(Name:="Email address")> _
        Public Property Email() As String
            Get
                Return emailValue
            End Get
            Set(ByVal value As String)
                emailValue = value
            End Set
        End Property

        <Required()> _
        <StringLength(100, ErrorMessage:="The {0} must be at least {2} characters long.", MinimumLength:=6)> _
        <DataType(DataType.Password)> _
        <Display(Name:="Password")> _
        Public Property Password() As String
            Get
                Return passwordValue
            End Get
            Set(ByVal value As String)
                passwordValue = value
            End Set
        End Property

        <DataType(DataType.Password)> _
        <Display(Name:="Confirm password")> _
        <Compare("Password", ErrorMessage:="The password and confirmation password do not match.")> _
        Public Property ConfirmPassword() As String
            Get
                Return confirmPasswordValue
            End Get
            Set(ByVal value As String)
                confirmPasswordValue = value
            End Set
        End Property
    End Class
End Namespace